package com.codeforces.contest.c320;

import java.util.Queue;
import java.util.Scanner;
import java.util.concurrent.ArrayBlockingQueue;


public class B {

	static Scanner scanner = new Scanner(System.in);
	static int n, nitv, type, src, dst;
	static interval[] itvs = new interval[200];
	static int[][] m = new int[200][200];

	public static void main(String[] args) {
		n = scanner.nextInt();
		nitv = 0;
		for (int i=1;i<=n;++i) {
			type = scanner.nextInt();
			if (type == 1) {
				nitv++;
				src = scanner.nextInt();
				dst = scanner.nextInt();
				itvs[nitv] = new interval(src, dst);
				for (int j=1;j<nitv;++j) {
					if (itvs[nitv].cut(itvs[j])) {
						m[nitv][j] = 1;
					}
					if (itvs[j].cut(itvs[nitv])) {
						 m[j][nitv] = 1;
					}
				}
			}
			else if (type == 2) {
				src = scanner.nextInt();
				dst = scanner.nextInt();
				if (haspath(src, dst)) {
					m[src][dst] = 1;
					System.out.println("YES");
				}
				else {
					System.out.println("NO");
				}
			}
		}
	}

	private static boolean haspath(int from, int to) {
		int[] visit = new int[200];
		Queue<Integer> qu = new ArrayBlockingQueue(200);
		qu.add(from);
		visit[from] = 1;
		while (!qu.isEmpty()) {
			int top = qu.poll();
			for (int i=1;i<=nitv;++i) {
				if (visit[i] != 1) {
					if (m[top][i] == 1) {
						if (i == to) {
							return true;
						}
						else {
							qu.add(i);
							visit[i] = 1;
						}
					}
				}
			}
		}
		return false;
	}

}
class interval {
	int from;
	int to;
	interval(int from, int to) {
		this.from = from;
		this.to = to;
	}
	boolean cut(interval itv) {
		if (this.from > itv.from && this.from < itv.to) {
			return true;
		}
		else if (this.to > itv.from && this.to < itv.to) {
			return true;
		}
		return false;
	}
}